package com.cetc.nsfx.controller.sys;

import com.cetc.nsfx.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/sys/main")
public class MainController {
	@Autowired
	TestService testService;
	@RequestMapping("/toDemoList")
	public String toDemoList(){
		System.out.println("1111");
		return "/demo/form";
	}

	@RequestMapping("/index")
	public String index(){
		System.out.println("main-index");
		return "main";
	}

	public String toDemoForm(){
		return "demoForm";
	}
	@RequestMapping("/userTable")
	public String userTable(){
		return "/demo/userTable";
	}
	@RequestMapping("/formTable")
	public String formTable(){
		try{
			//测试代码后台数据库链接是否正常
			/*List<Map<String,String>> lst = testService.getUserList();
			List<Map<String,String>> lstUser = testService.pageList();
			System.out.println(lst.size());
			System.out.println("page = "+lstUser.size());*/
		}catch (Exception e){
			e.printStackTrace();
		}
		return "/demo/formTable";
	}

	@RequestMapping("/backup")
	public String toBackUpIndex(){
		return "/demo/index-backup";
	}
}
